// JavaScript Document
var adWidth="100px";
var adHeight="250px";
var adImg2="images/ad1.jpg";
var close_img2="images/close.png";

var adRight=document.createElement("div");
adRight.style.width=adWidth;
adRight.style.height=adHeight;
adRight.style.padding="0px";
adRight.style.position="absolute";
adRight.style.right="50px";
adRight.style.top="20px";

var ad_img2=document.createElement("img");
ad_img2.src=adImg2;
adRight.appendChild(ad_img2);

var closeimg2=document.createElement("img");
closeimg2.src=close_img2;
closeimg2.style.width="50px";
closeimg2.style.position="relative";
closeimg2.style.left="50px";
closeimg2.style.top="-20px";
closeimg2.style.cursor="pointer";
adRight.appendChild(closeimg2);

document.documentElement.appendChild(adRight);

closeimg2.addEventListener("click",function(){
	adRight.style.display="none";
});

window.addEventListener("scroll",function(){
	var str1=document.documentElement.scrollTop||document.body.scrollTop;
	adRight.style.top=(str1+20)+"px";
});